package com.sx.first.biz;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.sx.first.biz.DepartmentBiz;
import com.sx.first.dao.DepartmentDAO;
import com.sx.first.model.Department;

@Service("departmentBiz")
@Scope("prototype")
public class DepartmentBiz {
	private DepartmentDAO departmentDAO;
	
	
	public void setDepartmentDAO(DepartmentDAO departmentDAO) {
		this.departmentDAO = departmentDAO;
	}

	public List<Department> findAll(){
		return departmentDAO.findAll();
	}

	public void save(Department dep) {
		departmentDAO.save(dep);
		
	}

	public Department findByClaId(int depId) {
		return departmentDAO.findById(depId);
	}

	public void delete(int depId) {
		departmentDAO.delete(departmentDAO.findById(depId));
		
	}

	public void update(Department dep) {
		departmentDAO.update(dep);
		
	}
	

}
